/*****************************************************************************
*        描述 :
*             文件描述
*        CLR版本:            3.5
*        创建者 :            蒋 光
*        个人域名:           jiangguang.net.cn
*        命名空间名称:       ECP.Model
*        文件名:             BaseStaffEntity.cs
*        创建系统时间:       2012/11/2 19:07:03
*        创建年份:           2012
*
/*****************************************************************************/

namespace ECP.Model
{
    using System;
    using System.Data;
    using ECP.Utilities;

    [Serializable]
    public class BaseStaffEntity
    {
        private string age;
        private string bankCode;
        private string birthday;
        private string code;
        private string companyCode;
        private string companyFullName;
        private string companyID;
        private string competency;
        private string createDate;
        private string createUserID;
        private string degree;
        private string departmentCode;
        private string departmentFullName;
        private string departmentID;
        private string description;
        private string dimissionCause;
        private string dimissionDate;
        private string dimissionWhither;
        private string dutyFullName;
        private string dutyID;
        private string education;
        private string email;
        private bool enabled;
        private string homeAddress;
        private string homeFax;
        private string homePhone;
        private string homeZipCode;
        private string id;
        private string iDCard;
        private string isDimission;
        private string joinInDate;
        private string major;
        private string mobile;
        private string modifyDate;
        private string modifyUserID;
        private string nation;
        private string nationality;
        private string nativePlace;
        private string officeAddress;
        private string officeFax;
        private string officePhone;
        private string officeZipCode;
        private string oICQ;
        private string party;
        private string realname;
        private string school;
        private string sex;
        private string shortNumber;
        private string sortCode;
        private string telephone;
        private string titleDate;
        private string titleFullName;
        private string titleID;
        private string titleLevel;
        private string userID;
        private string username;
        private string wed;
        private string workgroupCode;
        private string workgroupFullName;
        private string workgroupID;
        private string workingDate;
        private string workingProperty;

        public BaseStaffEntity()
        {
            this.enabled = true;
        }

        public BaseStaffEntity(DataRow dataRow)
        {
            this.enabled = true;
            this.GetFrom(dataRow);
        }

        public BaseStaffEntity(DataTable dataTable)
        {
            this.enabled = true;
            this.GetFrom(dataTable);
        }

        public BaseStaffEntity GetFrom(DataRow dataRow)
        {
            this.ID = BaseBusinessLogic.ConvertToString(dataRow[BaseStaffTable.FieldID]);
            this.UserID = BaseBusinessLogic.ConvertToString(dataRow[BaseStaffTable.FieldUserID]);
            this.Username = BaseBusinessLogic.ConvertToString(dataRow[BaseStaffTable.FieldUsername]);
            this.Realname = BaseBusinessLogic.ConvertToString(dataRow[BaseStaffTable.FieldRealname]);
            this.Code = BaseBusinessLogic.ConvertToString(dataRow[BaseStaffTable.FieldCode]);
            this.CompanyID = BaseBusinessLogic.ConvertToString(dataRow[BaseStaffTable.FieldCompanyID]);
            if (dataRow.Table.Columns.Contains("CompanyCode"))
            {
                this.CompanyCode = BaseBusinessLogic.ConvertToString(dataRow["CompanyCode"]);
            }
            if (dataRow.Table.Columns.Contains("CompanyFullName"))
            {
                this.CompanyFullName = BaseBusinessLogic.ConvertToString(dataRow["CompanyFullName"]);
            }
            this.DepartmentID = BaseBusinessLogic.ConvertToString(dataRow[BaseStaffTable.FieldDepartmentID]);
            if (dataRow.Table.Columns.Contains("DepartmentCode"))
            {
                this.DepartmentCode = BaseBusinessLogic.ConvertToString(dataRow["DepartmentCode"]);
            }
            if (dataRow.Table.Columns.Contains("DepartmentFullName"))
            {
                this.DepartmentFullName = BaseBusinessLogic.ConvertToString(dataRow["DepartmentFullName"]);
            }
            this.WorkgroupID = BaseBusinessLogic.ConvertToString(dataRow[BaseStaffTable.FieldWorkgroupID]);
            if (dataRow.Table.Columns.Contains("WorkgroupCode"))
            {
                this.WorkgroupCode = BaseBusinessLogic.ConvertToString(dataRow["WorkgroupCode"]);
            }
            if (dataRow.Table.Columns.Contains("WorkgroupFullName"))
            {
                this.WorkgroupFullName = BaseBusinessLogic.ConvertToString(dataRow["WorkgroupFullName"]);
            }
            this.DutyID = BaseBusinessLogic.ConvertToString(dataRow[BaseStaffTable.FieldDutyID]);
            this.IDCard = BaseBusinessLogic.ConvertToString(dataRow[BaseStaffTable.FieldIDCard]);
            this.BankCode = BaseBusinessLogic.ConvertToString(dataRow[BaseStaffTable.FieldBankCode]);
            this.Email = BaseBusinessLogic.ConvertToString(dataRow[BaseStaffTable.FieldEmail]);
            this.Mobile = BaseBusinessLogic.ConvertToString(dataRow[BaseStaffTable.FieldMobile]);
            this.ShortNumber = BaseBusinessLogic.ConvertToString(dataRow[BaseStaffTable.FieldShortNumber]);
            this.Telephone = BaseBusinessLogic.ConvertToString(dataRow[BaseStaffTable.FieldTelephone]);
            this.OICQ = BaseBusinessLogic.ConvertToString(dataRow[BaseStaffTable.FieldOICQ]);
            this.OfficePhone = BaseBusinessLogic.ConvertToString(dataRow[BaseStaffTable.FieldOfficePhone]);
            this.OfficeZipCode = BaseBusinessLogic.ConvertToString(dataRow[BaseStaffTable.FieldOfficeZipCode]);
            this.OfficeAddress = BaseBusinessLogic.ConvertToString(dataRow[BaseStaffTable.FieldOfficeAddress]);
            this.OfficeFax = BaseBusinessLogic.ConvertToString(dataRow[BaseStaffTable.FieldOfficeFax]);
            this.HomePhone = BaseBusinessLogic.ConvertToString(dataRow[BaseStaffTable.FieldHomePhone]);
            this.Age = BaseBusinessLogic.ConvertToString(dataRow[BaseStaffTable.FieldAge]);
            this.Wed = BaseBusinessLogic.ConvertToString(dataRow[BaseStaffTable.FieldWed]);
            this.Sex = BaseBusinessLogic.ConvertToString(dataRow[BaseStaffTable.FieldSex]);
            this.Birthday = BaseBusinessLogic.ConvertToString(dataRow[BaseStaffTable.FieldBirthday]);
            this.Education = BaseBusinessLogic.ConvertToString(dataRow[BaseStaffTable.FieldEducation]);
            this.School = BaseBusinessLogic.ConvertToString(dataRow[BaseStaffTable.FieldSchool]);
            this.Degree = BaseBusinessLogic.ConvertToString(dataRow[BaseStaffTable.FieldDegree]);
            this.TitleID = BaseBusinessLogic.ConvertToString(dataRow[BaseStaffTable.FieldTitleID]);
            if (dataRow.Table.Columns.Contains("TitleFullName"))
            {
                this.TitleFullName = BaseBusinessLogic.ConvertToString(dataRow["TitleFullName"]);
            }
            this.TitleDate = BaseBusinessLogic.ConvertToString(dataRow[BaseStaffTable.FieldTitleDate]);
            this.TitleLevel = BaseBusinessLogic.ConvertToString(dataRow[BaseStaffTable.FieldTitleLevel]);
            this.WorkingDate = BaseBusinessLogic.ConvertToString(dataRow[BaseStaffTable.FieldWorkingDate]);
            this.JoinInDate = BaseBusinessLogic.ConvertToString(dataRow[BaseStaffTable.FieldJoinInDate]);
            this.HomeZipCode = BaseBusinessLogic.ConvertToString(dataRow[BaseStaffTable.FieldHomeZipCode]);
            this.HomeAddress = BaseBusinessLogic.ConvertToString(dataRow[BaseStaffTable.FieldHomeAddress]);
            this.HomeFax = BaseBusinessLogic.ConvertToString(dataRow[BaseStaffTable.FieldHomeFax]);
            this.NativePlace = BaseBusinessLogic.ConvertToString(dataRow[BaseStaffTable.FieldNativePlace]);
            this.Party = BaseBusinessLogic.ConvertToString(dataRow[BaseStaffTable.FieldParty]);
            this.Nation = BaseBusinessLogic.ConvertToString(dataRow[BaseStaffTable.FieldNation]);
            this.Nationality = BaseBusinessLogic.ConvertToString(dataRow[BaseStaffTable.FieldNationality]);
            this.Major = BaseBusinessLogic.ConvertToString(dataRow[BaseStaffTable.FieldMajor]);
            this.WorkingProperty = BaseBusinessLogic.ConvertToString(dataRow[BaseStaffTable.FieldWorkingProperty]);
            this.Competency = BaseBusinessLogic.ConvertToString(dataRow[BaseStaffTable.FieldCompetency]);
            this.IsDimission = BaseBusinessLogic.ConvertToString(dataRow[BaseStaffTable.FieldIsDimission]);
            this.DimissionDate = BaseBusinessLogic.ConvertToString(dataRow[BaseStaffTable.FieldDimissionDate]);
            this.DimissionCause = BaseBusinessLogic.ConvertToString(dataRow[BaseStaffTable.FieldDimissionCause]);
            this.DimissionWhither = BaseBusinessLogic.ConvertToString(dataRow[BaseStaffTable.FieldDimissionWhither]);
            this.Enabled = BaseBusinessLogic.ConvertIntToBoolean(dataRow[BaseStaffTable.FieldEnabled]);
            this.SortCode = BaseBusinessLogic.ConvertToString(dataRow[BaseStaffTable.FieldSortCode]);
            this.Description = BaseBusinessLogic.ConvertToString(dataRow[BaseStaffTable.FieldDescription]);
            this.CreateDate = BaseBusinessLogic.ConvertToString(dataRow[BaseStaffTable.FieldCreateDate]);
            this.CreateUserID = BaseBusinessLogic.ConvertToString(dataRow[BaseStaffTable.FieldCreateUserID]);
            this.ModifyDate = BaseBusinessLogic.ConvertToString(dataRow[BaseStaffTable.FieldModifyDate]);
            this.ModifyUserID = BaseBusinessLogic.ConvertToString(dataRow[BaseStaffTable.FieldModifyUserID]);
            return this;
        }

        public BaseStaffEntity GetFrom(DataTable dataTable)
        {
            if ((dataTable == null) || (dataTable.Rows.Count == 0))
            {
                return null;
            }
            foreach (DataRow row in dataTable.Rows)
            {
                this.GetFrom(row);
                break;
            }
            return this;
        }

        public string Age
        {
            get
            {
                return this.age;
            }
            set
            {
                this.age = value;
            }
        }

        public string BankCode
        {
            get
            {
                return this.bankCode;
            }
            set
            {
                this.bankCode = value;
            }
        }

        public string Birthday
        {
            get
            {
                return this.birthday;
            }
            set
            {
                this.birthday = value;
            }
        }

        public string Code
        {
            get
            {
                return this.code;
            }
            set
            {
                this.code = value;
            }
        }

        public string CompanyCode
        {
            get
            {
                return this.companyCode;
            }
            set
            {
                this.companyCode = value;
            }
        }

        public string CompanyFullName
        {
            get
            {
                return this.companyFullName;
            }
            set
            {
                this.companyFullName = value;
            }
        }

        public string CompanyID
        {
            get
            {
                return this.companyID;
            }
            set
            {
                this.companyID = value;
            }
        }

        public string Competency
        {
            get
            {
                return this.competency;
            }
            set
            {
                this.competency = value;
            }
        }

        public string CreateDate
        {
            get
            {
                return this.createDate;
            }
            set
            {
                this.createDate = value;
            }
        }

        public string CreateUserID
        {
            get
            {
                return this.createUserID;
            }
            set
            {
                this.createUserID = value;
            }
        }

        public string Degree
        {
            get
            {
                return this.degree;
            }
            set
            {
                this.degree = value;
            }
        }

        public string DepartmentCode
        {
            get
            {
                return this.departmentCode;
            }
            set
            {
                this.departmentCode = value;
            }
        }

        public string DepartmentFullName
        {
            get
            {
                return this.departmentFullName;
            }
            set
            {
                this.departmentFullName = value;
            }
        }

        public string DepartmentID
        {
            get
            {
                return this.departmentID;
            }
            set
            {
                this.departmentID = value;
            }
        }

        public string Description
        {
            get
            {
                return this.description;
            }
            set
            {
                this.description = value;
            }
        }

        public string DimissionCause
        {
            get
            {
                return this.dimissionCause;
            }
            set
            {
                this.dimissionCause = value;
            }
        }

        public string DimissionDate
        {
            get
            {
                return this.dimissionDate;
            }
            set
            {
                this.dimissionDate = value;
            }
        }

        public string DimissionWhither
        {
            get
            {
                return this.dimissionWhither;
            }
            set
            {
                this.dimissionWhither = value;
            }
        }

        public string DutyFullName
        {
            get
            {
                return this.dutyFullName;
            }
            set
            {
                this.dutyFullName = value;
            }
        }

        public string DutyID
        {
            get
            {
                return this.dutyID;
            }
            set
            {
                this.dutyID = value;
            }
        }

        public string Education
        {
            get
            {
                return this.education;
            }
            set
            {
                this.education = value;
            }
        }

        public string Email
        {
            get
            {
                return this.email;
            }
            set
            {
                this.email = value;
            }
        }

        public bool Enabled
        {
            get
            {
                return this.enabled;
            }
            set
            {
                this.enabled = value;
            }
        }

        public string HomeAddress
        {
            get
            {
                return this.homeAddress;
            }
            set
            {
                this.homeAddress = value;
            }
        }

        public string HomeFax
        {
            get
            {
                return this.homeFax;
            }
            set
            {
                this.homeFax = value;
            }
        }

        public string HomePhone
        {
            get
            {
                return this.homePhone;
            }
            set
            {
                this.homePhone = value;
            }
        }

        public string HomeZipCode
        {
            get
            {
                return this.homeZipCode;
            }
            set
            {
                this.homeZipCode = value;
            }
        }

        public string ID
        {
            get
            {
                return this.id;
            }
            set
            {
                this.id = value;
            }
        }

        public string IDCard
        {
            get
            {
                return this.iDCard;
            }
            set
            {
                this.iDCard = value;
            }
        }

        public string IsDimission
        {
            get
            {
                return this.isDimission;
            }
            set
            {
                this.isDimission = value;
            }
        }

        public string JoinInDate
        {
            get
            {
                return this.joinInDate;
            }
            set
            {
                this.joinInDate = value;
            }
        }

        public string Major
        {
            get
            {
                return this.major;
            }
            set
            {
                this.major = value;
            }
        }

        public string Mobile
        {
            get
            {
                return this.mobile;
            }
            set
            {
                this.mobile = value;
            }
        }

        public string ModifyDate
        {
            get
            {
                return this.modifyDate;
            }
            set
            {
                this.modifyDate = value;
            }
        }

        public string ModifyUserID
        {
            get
            {
                return this.modifyUserID;
            }
            set
            {
                this.modifyUserID = value;
            }
        }

        public string Nation
        {
            get
            {
                return this.nation;
            }
            set
            {
                this.nation = value;
            }
        }

        public string Nationality
        {
            get
            {
                return this.nationality;
            }
            set
            {
                this.nationality = value;
            }
        }

        public string NativePlace
        {
            get
            {
                return this.nativePlace;
            }
            set
            {
                this.nativePlace = value;
            }
        }

        public string OfficeAddress
        {
            get
            {
                return this.officeAddress;
            }
            set
            {
                this.officeAddress = value;
            }
        }

        public string OfficeFax
        {
            get
            {
                return this.officeFax;
            }
            set
            {
                this.officeFax = value;
            }
        }

        public string OfficePhone
        {
            get
            {
                return this.officePhone;
            }
            set
            {
                this.officePhone = value;
            }
        }

        public string OfficeZipCode
        {
            get
            {
                return this.officeZipCode;
            }
            set
            {
                this.officeZipCode = value;
            }
        }

        public string OICQ
        {
            get
            {
                return this.oICQ;
            }
            set
            {
                this.oICQ = value;
            }
        }

        public string Party
        {
            get
            {
                return this.party;
            }
            set
            {
                this.party = value;
            }
        }

        public string Realname
        {
            get
            {
                return this.realname;
            }
            set
            {
                this.realname = value;
            }
        }

        public string School
        {
            get
            {
                return this.school;
            }
            set
            {
                this.school = value;
            }
        }

        public string Sex
        {
            get
            {
                return this.sex;
            }
            set
            {
                this.sex = value;
            }
        }

        public string ShortNumber
        {
            get
            {
                return this.shortNumber;
            }
            set
            {
                this.shortNumber = value;
            }
        }

        public string SortCode
        {
            get
            {
                return this.sortCode;
            }
            set
            {
                this.sortCode = value;
            }
        }

        public string Telephone
        {
            get
            {
                return this.telephone;
            }
            set
            {
                this.telephone = value;
            }
        }

        public string TitleDate
        {
            get
            {
                return this.titleDate;
            }
            set
            {
                this.titleDate = value;
            }
        }

        public string TitleFullName
        {
            get
            {
                return this.titleFullName;
            }
            set
            {
                this.titleFullName = value;
            }
        }

        public string TitleID
        {
            get
            {
                return this.titleID;
            }
            set
            {
                this.titleID = value;
            }
        }

        public string TitleLevel
        {
            get
            {
                return this.titleLevel;
            }
            set
            {
                this.titleLevel = value;
            }
        }

        public string UserID
        {
            get
            {
                return this.userID;
            }
            set
            {
                this.userID = value;
            }
        }

        public string Username
        {
            get
            {
                return this.username;
            }
            set
            {
                this.username = value;
            }
        }

        public string Wed
        {
            get
            {
                return this.wed;
            }
            set
            {
                this.wed = value;
            }
        }

        public string WorkgroupCode
        {
            get
            {
                return this.workgroupCode;
            }
            set
            {
                this.workgroupCode = value;
            }
        }

        public string WorkgroupFullName
        {
            get
            {
                return this.workgroupFullName;
            }
            set
            {
                this.workgroupFullName = value;
            }
        }

        public string WorkgroupID
        {
            get
            {
                return this.workgroupID;
            }
            set
            {
                this.workgroupID = value;
            }
        }

        public string WorkingDate
        {
            get
            {
                return this.workingDate;
            }
            set
            {
                this.workingDate = value;
            }
        }

        public string WorkingProperty
        {
            get
            {
                return this.workingProperty;
            }
            set
            {
                this.workingProperty = value;
            }
        }
    }
}